import Mock from 'mockjs';
import { resultSuccess } from '../_util';

const menuList = () => {
  const result: any[] = [
    {
      label: 'Dashboard',
      key: '1',
      children: [
        {
          label: '主控台',
          key: '1-1'
        },
        {
          label: '工作台',
          key: '1-2'
        }
      ]
    },
    {
      label: '系统管理',
      key: '2',
      children: [
        {
          label: '主控台',
          key: '2-1'
        },
        {
          label: '工作台',
          key: '2-2'
        }
      ]
    }
  ];
  return result;
};

export default [
  {
    url: '/menu/list',
    timeout: 1000,
    method: 'get',
    response: () => {
      const list = menuList();
      return resultSuccess(list);
    }
  }
];
